package com.example.zjx8969.myapplication.viewmodel;

import androidx.lifecycle.LiveData;
import android.content.Context;

import com.example.zjx8969.myapplication.cache.CacheFileManager;
import com.example.zjx8969.myapplication.net.InitBean;

public class InitialLiveData extends LiveData<InitBean> {
    private static InitialLiveData liveData;

    private InitialLiveData(Context applicationContext) {
        InitBean initBean = CacheFileManager.getInstance().cacheManager.readContent("jGmrobJyKtE", InitBean.class);
        liveData.postValue(initBean);

    }

    public synchronized static InitialLiveData get(Context context) {
        if (liveData == null) {
            liveData = new InitialLiveData(context.getApplicationContext());
        }
        return liveData;
    }


}
